<?php 
/*
   Copyright 2010, Sanket Parab

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
   
   This is a Test User Interface meant for demo purposes.
 */
if (isset($_POST['logout_submit'])) {
	unset($_SESSION['instructor']);
	session_unset();
	session_destroy();
	setcookie('etat_login','',0);
	redirect('index.php?m=1');
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-type">
<title><?php print $page_title; ?></title>
<meta content="electronic teamwork assessment tool" name="description">
<meta content="electronic, teamwork, assessment, teamwork assessment, participation metrics" name="keywords">
<link type="image/png" href="<?php print BRANCH; ?>favicon.png" rel="icon"><?php
foreach($style_sheet as $css) {
	if(file_exists(ROOT . BRANCH . "includes/$css.css"))
	print "<link href='" . HOST . "/includes/$css.css' rel='stylesheet' type='text/css'>";
}
foreach($java_script as $js) {
	if(file_exists(ROOT . BRANCH . "/includes/$js.js"))
	print "<script language='JavaScript' type='text/javascript' src='" . HOST . "/includes/$js.js'></script>";
}
?>
</head>
<body>
<div id="fade" class='invisible' onclick='closePopup();'></div>
<div id='header'>
<p id='host-name' class='none'><?php print HOST; ?></p>
<div id='header-wrap'>
<?php if(isLoggedIn()) { ?>
	<div id='logo'><img id='logo-logged-in' onclick="redirect('');" src='<?php print HOST; ?>/includes/images/btn/logo.png'></img></div>
	<?php
	$form = new Form('logout_form','post',true,array('class'=>'right'));
	$form->text("Welcome, <b>".$instructor->full_name.'.</b> ');
	$form->text("<div class='clear'></div>");
	$form->button('logout_submit','Logout',array('class'=>'right'),false);
	$form->button('profile','Profile',array('type'=>'button','onclick'=>'redirect("profile.php")','class'=>'right'),false);
	print $form->build();
} else {
	?>
	<div id='logo'>
		<img onclick="redirect('');" src='<?php print HOST; ?>/includes/images/btn/logo.png'></img>
		<span onclick="redirect('');">Electronic Teamwork Assessment Tool</span>
	</div>
	<div id='header-options'>
	<?php
	print button('login','Login',array('type'=>'button','onclick'=>'redirect("login.php");'),false);
	print button('admin','Admin',array('type'=>'button','onclick'=>'redirect("admin.php");'),false);
}
?>
	</div>
<div class='clear'></div>
</div>
</div>
<div id='<?php print URLNAME?>' class='content'>